@isTest
private class WorkOrderPDFControllerTest {
    static testMethod void testMethod1() {
        Account acc = TestUtils.createAccount();
        insert acc;

        Product__c pro = TestUtils.createProduct();
		pro.Category0__c='仪器';
		insert pro;

        //创建工单
         Case case2 = new Case(
			RecordTypeId=Utils.getRecordTypeIdByDevNameAndObjName('Service', 'Case'),
			AccountId=acc.Id,
			Origin='电话',
			Status='处理中',
			Manufacturer__c=pro.Id);
		insert case2;

		WorkOrder__c WO2 = new WorkOrder__c(
			RecordTypeId=Utils.getRecordTypeIdByDevNameAndObjName('ServiceOrder', 'WorkOrder__c'),
			Case__c=case2.Id,
			Status__c='生单',
			Account__c=acc.Id,
			WhetherToMakeASingle__c='否');
		insert WO2;
		//System.debug('+++'+wo2);
		//System.debug([select Account__c from WorkOrder__c where Id =:Wo2.Id]);

		

		Attachment att4 = new Attachment(
			Name='使用科室负责人_Sign.jpg',
			Body=Blob.ValueOf('123'),
			ParentId=WO2.Id);
		insert att4;
		Attachment att5 = new Attachment(
			Name='管理科室负责人_Sign.jpg',
			Body=Blob.valueOf('123'),
			ParentId=WO2.Id);
		insert att5;
		Attachment att6 = new Attachment(
			Name='工程师_Sign.jpg',
			Body=Blob.valueOf('123'),
			ParentId=WO2.Id);
		insert att6;

		//System.debug(acc.Id);

         PageReference page = new PageReference('apex/WorkorderPDFSelect?accid=' + acc.Id);
        	WorkorderPDFController con = new WorkorderPDFController();
          con.init();
          con.accId = acc.Id;


          con.workOrders=wo2.Id;

          //con.rtype = '服务工单';
          System.debug([select RecordType.Name,Account__c from WorkOrder__c where Account__c =:acc.Id]);

          System.debug([select Id,RecordType.Name,Account__c from WorkOrder__c where ID =:WO2.Id]);
          con.tempWo.Status__c = '生单';
          con.getWorkOders();
          con.woSelList[0].chk = true;
          con.exchange();
        	con.saveIds();

        	con.getWorkOrderInfo();




    }
}